<!--公告通知-->
<template>
  <div id="notice" class="app-container  flex-row">
    <div class="common-sub-vertical-menu">
      <ul class="vertical-menu">
        <li :class="noticeUserType==='admin'?'active':''" @click="handleNoticeUserTypeClick('admin')">
          <i class="icon el-icon-message" />
          <span>后台通知</span>
        </li>
        <li :class="noticeUserType==='member'?'active':''" @click="handleNoticeUserTypeClick('member')">
          <i class="icon el-icon-postcard" />
          <span>会员通知</span>
        </li>
      </ul>
    </div>
    <div class="flex-main conmmon-container-main">
      <component :is="noticeUserType" />
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import admin from './admin.vue'
import member from './member.vue'
export default {
  components: { admin, member },

  data() {
    return {
    }
  },
  computed: {
    ...mapState({
      noticeUserType: state => state['services/upms/system/UpmsNoticeService'].updateComponent
    })
  },
  watch: {
    noticeUserType(val) {
    }
  },

  created() {
  },
  methods: {
    handleNoticeUserTypeClick(type) {
      if (this.noticeUserType === type) {
        return
      }
      this.$store.dispatch('updateNoticeComponent', type)
    }
  }
}
</script>
<style lang="scss">
</style>
